package cn.bdqn.mallmgr.service.impl;

import cn.bdqn.mallmgr.dao.UserMapper;
import cn.bdqn.mallmgr.pojo.User;
import cn.bdqn.mallmgr.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author
 * @create 2022-07-12 11:33
 */
@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;

    /**
     * 登录
     *
     * @param userName 账号
     * @param password 密码
     * @return cn.bdqn.mallmgr.pojo.User
     */
    @Override
    public User login(String userName, String password) {
        return userMapper.login(userName, password);
    }

    /**
     * 注册
     *
     * @param user 注册用户
     * @return java.lang.Boolean
     */
    @Override
    public Boolean register(User user) {
        return userMapper.register(user) > 0;
    }
}
